home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / A deeper u3100110252001.psc / BitSet.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  2001-10-25  |  10.1 KB  |  305 lines

  1. VERSION 5.00
  2. Begin VB.Form frmBitSetOperations 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Bit-Set Demo In Visual Basic"
  5.    ClientHeight    =   2520
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   6045
  9.    Icon            =   "BitSet.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2520
  15.    ScaleWidth      =   6045
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.OptionButton optNumber 
  18.       Caption         =   "Binary"
  19.       Height          =   195
  20.       Index           =   1
  21.       Left            =   270
  22.       TabIndex        =   13
  23.       Top             =   1395
  24.       Width           =   1590
  25.    End
  26.    Begin VB.OptionButton optNumber 
  27.       Caption         =   "Long Integer"
  28.       Height          =   195
  29.       Index           =   0
  30.       Left            =   270
  31.       TabIndex        =   12
  32.       Top             =   810
  33.       Value           =   -1  'True
  34.       Width           =   1545
  35.    End
  36.    Begin VB.CommandButton cmddone 
  37.       Caption         =   "done"
  38.       Height          =   375
  39.       Left            =   4950
  40.       TabIndex        =   11
  41.       Top             =   1755
  42.       Width           =   975
  43.    End
  44.    Begin VB.CommandButton cmdeqv 
  45.       Caption         =   "eqv"
  46.       Height          =   375
  47.       Left            =   4950
  48.       TabIndex        =   10
  49.       Top             =   945
  50.       Width           =   975
  51.    End
  52.    Begin VB.CommandButton cmdimp 
  53.       Caption         =   "imp"
  54.       Height          =   375
  55.       Left            =   4950
  56.       TabIndex        =   9
  57.       Top             =   540
  58.       Width           =   975
  59.    End
  60.    Begin VB.CommandButton cmdxor 
  61.       Caption         =   "xor"
  62.       Height          =   375
  63.       Left            =   3600
  64.       TabIndex        =   8
  65.       Top             =   1755
  66.       Width           =   975
  67.    End
  68.    Begin VB.CommandButton cmdor 
  69.       Caption         =   "or"
  70.       Height          =   375
  71.       Left            =   3600
  72.       TabIndex        =   7
  73.       Top             =   1350
  74.       Width           =   975
  75.    End
  76.    Begin VB.CommandButton cmdand 
  77.       Caption         =   "and"
  78.       Height          =   375
  79.       Left            =   3600
  80.       TabIndex        =   6
  81.       Top             =   945
  82.       Width           =   975
  83.    End
  84.    Begin VB.CommandButton cmdnot 
  85.       Caption         =   "not"
  86.       Height          =   375
  87.       Left            =   3600
  88.       TabIndex        =   5
  89.       Top             =   540
  90.       Width           =   975
  91.    End
  92.    Begin VB.CommandButton cmdror 
  93.       Caption         =   "ror"
  94.       Height          =   375
  95.       Left            =   2205
  96.       TabIndex        =   4
  97.       Top             =   1755
  98.       Width           =   975
  99.    End
  100.    Begin VB.CommandButton cmdrol 
  101.       Caption         =   "rol"
  102.       Height          =   375
  103.       Left            =   2205
  104.       TabIndex        =   3
  105.       Top             =   1350
  106.       Width           =   975
  107.    End
  108.    Begin VB.CommandButton cmdshl 
  109.       Caption         =   "shl"
  110.       Height          =   375
  111.       Left            =   2205
  112.       TabIndex        =   2
  113.       Top             =   540
  114.       Width           =   975
  115.    End
  116.    Begin VB.CommandButton cmdshr 
  117.       Caption         =   "shr"
  118.       Height          =   375
  119.       Left            =   2205
  120.       TabIndex        =   1
  121.       Top             =   945
  122.       Width           =   975
  123.    End
  124.    Begin VB.TextBox txtNumber 
  125.       Alignment       =   1  'Right Justify
  126.       Appearance      =   0  'Flat
  127.       BeginProperty Font 
  128.          Name            =   "Courier New"
  129.          Size            =   8.25
  130.          Charset         =   0
  131.          Weight          =   400
  132.          Underline       =   0   'False
  133.          Italic          =   0   'False
  134.          Strikethrough   =   0   'False
  135.       EndProperty
  136.       Height          =   285
  137.       Left            =   90
  138.       MaxLength       =   16
  139.       TabIndex        =   0
  140.       Top             =   90
  141.       Width           =   5880
  142.    End
  143.    Begin VB.Shape shShadow 
  144.       BackColor       =   &H00808080&
  145.       BackStyle       =   1  'Opaque
  146.       BorderStyle     =   0  'Transparent
  147.       Height          =   285
  148.       Left            =   135
  149.       Top             =   135
  150.       Width           =   5865
  151.    End
  152.    Begin VB.Label lblStatbar 
  153.       Appearance      =   0  'Flat
  154.       BackColor       =   &H80000005&
  155.       BorderStyle     =   1  'Fixed Single
  156.       BeginProperty Font 
  157.          Name            =   "Courier New"
  158.          Size            =   9.75
  159.          Charset         =   0
  160.          Weight          =   400
  161.          Underline       =   0   'False
  162.          Italic          =   0   'False
  163.          Strikethrough   =   0   'False
  164.       EndProperty
  165.       ForeColor       =   &H80000008&
  166.       Height          =   240
  167.       Left            =   45
  168.       TabIndex        =   14
  169.       Top             =   2205
  170.       Width           =   5910
  171.    End
  172.    Begin VB.Shape Shape1 
  173.       BackColor       =   &H00808080&
  174.       BackStyle       =   1  'Opaque
  175.       BorderStyle     =   0  'Transparent
  176.       Height          =   240
  177.       Left            =   90
  178.       Top             =   2250
  179.       Width           =   5910
  180.    End
  181. Attribute VB_Name = "frmBitSetOperations"
  182. Attribute VB_GlobalNameSpace = False
  183. Attribute VB_Creatable = False
  184. Attribute VB_PredeclaredId = True
  185. Attribute VB_Exposed = False
  186. Public maxLimit As Long
  187. Public BinaryOn As Boolean
  188. Private Sub cmdand_Click()
  189.     Dim andValue As Long
  190.     andValue = GetNumber("Enter Number to be use in And", 65535)
  191.     lblStatbar.Caption = "and " & TNumber & ", " & andValue
  192.     txtNumber = WNumber(TNumber And andValue)
  193.     txtNumber.SetFocus
  194. End Sub
  195. Private Sub cmddone_Click()
  196.     Unload Me
  197. End Sub
  198. Private Sub cmdeqv_Click()
  199.     Dim eqvValue As Long
  200.     eqvValue = GetNumber("Enter Number to be use in Equvalent", 65535)
  201.     lblStatbar.Caption = "eqv " & TNumber & ", " & eqvValue
  202.     txtNumber = WNumber(TNumber Eqv eqvValue)
  203.     txtNumber.SetFocus
  204. End Sub
  205. Private Sub cmdimp_Click()
  206.     Dim impValue As Long
  207.     impValue = GetNumber("Enter Number to be use in Impression", 65535)
  208.     lblStatbar.Caption = "imp " & TNumber & ", " & impValue
  209.     txtNumber = WNumber(TNumber Imp impValue)
  210.     txtNumber.SetFocus
  211. End Sub
  212. Private Sub cmdnot_Click()
  213.     '
  214.     ' To pass the Signed NOT operator of Visual Basic, i used another
  215.     ' function, i called it not_()
  216.     '
  217.     lblStatbar = "not " & TNumber
  218.     txtNumber = WNumber(not_(TNumber))
  219.     txtNumber.SetFocus
  220. End Sub
  221. Private Sub cmdor_Click()
  222.     Dim orValue As Long
  223.     orValue = GetNumber("Enter Number to be use in Or", 65535)
  224.     lblStatbar.Caption = "or " & TNumber & ", " & orValue
  225.     txtNumber = WNumber(TNumber Or orValue)
  226.     txtNumber.SetFocus
  227. End Sub
  228. Private Sub cmdrol_Click()
  229.     Dim rolValue As Long
  230.     rolValue = GetNumber("Enter Number to be use in Rotating", 8)
  231.     If Len(int2bin(TNumber)) > Len(int2bin(rolValue)) Th)) Th))er Number to be use in Rotating", 8)
  232.     If Len(int2bin(TNumber)) > Len(int2binl8cr NumbIo0iaLen(int2bin(rolValue)) Th))  use in Or",pe    4
  233. 7.a    =   se in3=e    4
  234. 7.a    =   sn6",   4
  235. 7.a    =   se in3=e    4
  236. 7 r Th)) Th))er Numb cy    txtNumber.SetFocus
  237. End s8 > Len
  238.     If Le=d s85seiaLen(int2bin(rolValue)) Th))  use in Or",pe    4 To    =   se in3=e    4
  239. 7.a    =   sn6",   4
  240. 7.a    =   se in3=e    4
  241. 7 r Th)) Th))er Numb cy)) > Len(int2binl8cr NumbIo0iaLen(int2bin(rolValue)) Th))  use   285
  242.       Left            oLen
  243.     If Le=d s85seiaLen(int2bin(rolValue)) Th))  use in Or",pe    4 To    =   60>  '5,E"50Ne  sn6",   4
  244. 7.a    =   se in3=e    4
  245. 7 r Th)) Th)    4
  246. xiia0   =   se in3=e   ne)) Tho3333333333o  se in3=e    4
  247. 7 r Th)) Th))er Ngt in Impression", 65535)
  248.     lblStatbar.Caption = "imp " & TNumbc0g"aptq9um 4
  249. 7.alValue)) Th)) s"aptq9u87H   1  'Opaque
  250.       Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth           =   975
  251.    2   'Falseyqv eqvValue)
  252.     Styg  2sFalseyqv eqvValue)
  253.     Styg  2sFalseyqv eqvValue)
  254.     Styg  2sFalseyqv eqvValue)
  255.     St2   'Falseyd
  256.    Begin VB.Shape shShadow 
  257.       BackColor       =   &H00808080&
  258.       BackStyle       g)rv
  259.       BackStyle       =   1  'Opaque
  260.       BorderStyle     =   0  'Transparent
  261.       Heigh0BValue)
  262.     Styg  2sFalseyqptioabNumEP
  263.     tHtse in Or",iOBte6550.c9yle  yleP
  264.  eigh0BVal(o5alickosFayqv eqvValue)
  265.  ue)t5N t0Hptq9u87H   1  'Opaque
  266.       Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth           =   975
  267.    2 8(aP<            =   975&
  268.           3FalsStyle       g)rv
  269.       On As BooleanF9Fayiorut2 ThruOfkOpaqlue)
  270.  ue)t5N t0Hptq9u87H   1 BooleanF9mEP
  271.     t    g)rv
  272.       On As BooleanF9Fayiorut2 ThruOfkOpaqluFayianF9mEP
  273.  t    g)rv
  274.       On As BooleanF9Fayiorut2 Thrrrr
  275.  ue)t5N t0Hptq9u87H   1  lr.Caption = 90BVal(o5alickosFayqv eqvValue)
  276.  ue)t5N use in Orc .Orc .Orc .Orc .Orc .Orc .7O2Le=d s85s5Opaque
  277.       Borderut2 Thrut2 Thrut2 Thrut2 ThruOfkdth           =   975
  278.    2 8(aP<      s8n.1d   =   975
  279.    2 8(aP<      , OnuitvavValu
  280.    le  yleP
  281.  eif  3Bus1d ylePaOvavValu
  282.    >arent
  283.    t7 &ircrashc0etFocus
  284. 72ayiorut2 Thrrrr
  285.  ue)t5N t0Hp
  286.     ' T2ayiorut2wt<e Sub cmdand_Click()
  287.     Dim andValue As Long
  288.     andValue = GetNumber("Enter Numbe)xon=T ' T2ayiorut2wt<e Sub cmdand_Click()
  289.     Dim andValue As Long
  290.     andValue = Getoisby   2 8(aP<      , OnuitvavValu
  291.    le  yleP
  292.  eif  3Bus1d ylePaO:_         =   285
  293.       Left            =   135
  294.     ut2 Thrut2 Thrut2 ThruOfkdth        'Opaque
  295. dand_Clicu    Unlo_  cu    Unl) {C, Thrut2  s8    Wir1roE2 T us6N1eer.SetFocohrut2 Thruim aUnl) {C, ThmWNumber(TNumber 7aO:_         =   285
  296.       Left           g)rv
  297.       OnndValue A4x2 Troperty Font 
  298.        rv
  299. 8biv5A5eriValuU.t       'OCbar Eqri5eriValuU.t       'OCbar Eqrired0riValuUaeu8uU.t Thmp)
  300.     DiRw l
  301. impi8uU.t Thmp)
  302.     gh=   135
  303.     ut2Ofkdth        'Opaque
  304. dand_Clicu    Unlo_  cu    Unl) {C, Thrut2  s8    Wirber.=r.Caption = 90BVal(o5alickosFayqv eqvValPeu8uU.Number(
  305.